#!/usr/bin/env python
#coding:utf-8

class A:
    def __init__(self):
        print '__init__'

    def method(self):
        return 'method'

    def __p(self):
        return '__p'

    def p(self):
        return self.__p()

if __name__ == '__main__':
    a = A()
    print "getattr(a, 'method')() =>", getattr(a, 'method', 'default')()
    print getattr(a, 'mod', 'default')
    print "a.method()=>", a.method()
